package cn.edu.ntu.yyl.dao;

import cn.edu.ntu.yyl.pojo.article.Article;
import cn.edu.ntu.yyl.pojo.article.ArticleComment;
import cn.edu.ntu.yyl.pojo.user.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface Article_commentDao {
    // 增
    Integer InsertNewComment(ArticleComment articleComment);
    // 删
    Integer DeleteComment(ArticleComment articleComment);
    // 改
    Integer UpdateComment(ArticleComment articleComment);
    // 查
    List<ArticleComment> SelectAllComment();
    //按Id查询
    ArticleComment SelectCommentById(Integer Id);
    //审核评论
    Integer CheckComment(ArticleComment articleComment);
    //赞赏评论
    Integer GivelikeComment(ArticleComment articleComment);
    //按照状态查询
    List<ArticleComment> SelectCommentByStatus(String status);
    //置顶评论
    Integer RecommendComment(ArticleComment articleComment);
    //查看文章的评论
    List<ArticleComment> SelectCommentByArticle(Article article);
    //查看该评论的父评论
    ArticleComment SelectFatherCommentByComment(ArticleComment articleComment);
    //查看该评论的子评论
    List<ArticleComment> SelectChildrenCommentByComment(ArticleComment articleComment);
    //查看某用户的评论
    List<ArticleComment> SelectCommentByUser(UserInfo userInfo);
    //更新评论回复数量
    Integer UpdateCommentReplyCount(ArticleComment articleComment);
    //按照ip获取评论
    List<ArticleComment> SelectCommentByIP(String ip);

    //时间线查询
    List<ArticleComment> SelectTodayComment();
    List<ArticleComment> SelectYesterdayComment();
    List<ArticleComment> SelectSevenDayComment();
    List<ArticleComment> SelectFourteenDayComment();
    List<ArticleComment> SelectMonthComment();
}
